package com.member.common.enums;


import lombok.Getter;

import java.util.Objects;

/*
 * 评价来源
 */
@Getter
public enum SourceEnum {
    TO_BE_SHIPPED(0, "用户"),
    SHIPPED( 1, "后台"),
    ;

    private final Integer key;
    private final String desc;

    SourceEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static SourceEnum getByKey(Integer _key) {
        for (SourceEnum item : SourceEnum.values()) {
            if (Objects.equals(item.getKey(), _key)) {
                return item;
            }
        }
        return null;
    }

}
